package context

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

type HttpContext struct {
	*gin.Context
}

func NewHttpContext(c *gin.Context) *HttpContext {
	return &HttpContext{Context: c}
}

func (c *HttpContext) OK(data any) {
	c.JSON(http.StatusOK, data)
}

func (c *HttpContext) BadRequest(data any) {
	c.JSON(http.StatusBadRequest, data)
}

func (c *HttpContext) NotFound(data any) {
	c.JSON(http.StatusNotFound, data)
}

func (c *HttpContext) InternalServerError(data any) {
	c.JSON(http.StatusInternalServerError, data)
}

func (c *HttpContext) Unauthorized() {
	c.AbortWithStatus(http.StatusUnauthorized)
}

func (c *HttpContext) Forbidden() {
	c.AbortWithStatus(http.StatusForbidden)
}
